package com.jinyu.dao.entity.sys;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;

import java.io.Serial;
import java.io.Serializable;

/**
 * @Author: yangli
 * @Despriction:    角色基本信息
 * @Package: com.jinyu.dao.entity.sys
 * @Date:Created in 2022/5/5 20:37
 * @Modify By:
 */
public class SysRole implements Serializable {

    @Serial
    private static final long serialVersionUID = 2593811652023404595L;

    /**
     *  主键id
     */
    private Long id;


    /**
     *  角色编码
     */
    @NotNull(message = "角色编码不能为空")
    @NotBlank(message = "角色编码不能为空")
    @Pattern(regexp = "^(?!_)(?!.*?_$)[0-9a-zA-Z_]{1,20}$",message = "角色编码必须是由英文、数字、下划线组成，且下划线不能在头部或者末尾")
    private String roleCode;


    /**
     *  角色名称
     */
    @NotNull(message = "角色名称不能为空")
    @NotBlank(message = "角色名称不能为空")
    @Pattern(regexp = "^(?!_)(?!.*?_$)[0-9a-zA-Z_\\u4e00-\\u9fa5]{1,20}$",message = "用户名称必须是由汉字、英文、数字、下划线组成，且下划线不能在头部或者末尾")
    private String roleName;


    /**
     *  是否启用(0：禁用；1：启用)
     */
    private Integer enabled = 1;


    /**
     *  创建时间
     */
    private String createTime;


    /**
     *  创建人
     */
    private String createUser;


    /**
     *  修改时间
     */
    private String updateTime;


    /**
     *  修改人
     */
    private String updateUser;


    /**
     *  删除标志(0：未删除；1：已删除)
     */
    private Integer delFlag = 0;


    /**
     *  备注
     */
    private String remark;

    @Override
    public String toString() {
        return "SysRole{" +
                "id=" + id +
                ", roleCode='" + roleCode + '\'' +
                ", roleName='" + roleName + '\'' +
                ", enabled=" + enabled +
                ", createTime='" + createTime + '\'' +
                ", createUser='" + createUser + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", updateUser='" + updateUser + '\'' +
                ", delFlag=" + delFlag +
                ", remark='" + remark + '\'' +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Integer getEnabled() {
        return enabled;
    }

    public void setEnabled(Integer enabled) {
        this.enabled = enabled;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
